{# Rendered with \Sylius\Bundle\AdminBundle\Twig\Component\Shipment\ShipFormComponent #}

{% form_theme form '@SyliusAdmin/shared/form_theme.html.twig' %}

{% set path = path|default('sylius_admin_shipment_ship') %}
{% set path_parameters = path_parameters|default({id: resource.id}) %}

{% if sylius_sm_can(resource, 'sylius_shipment', 'ship') %}
    <div {{ attributes }}>
        {{ form_start(form, {'action': path(path, path_parameters), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate'}}) }}
        <input type="hidden" name="_method" value="PUT">
        <div class="input-group flex-nowrap">
            {{ form_widget(form.tracking, sylius_test_form_attribute('shipment-tracking')|sylius_merge_recursive({'attr': {'placeholder': 'sylius.ui.tracking_code'|trans ~ '...', 'style': 'min-width: 130px;'}})) }}
            <button type="submit" class="btn" {{ sylius_test_html_attribute('shipment-ship-button') }}>
                {{ ux_icon('tabler:truck') }}
                {{ 'sylius.ui.ship'|trans }}
            </button>
        </div>
        {{ form_row(form._token) }}
        {{ form_end(form, {'render_rest': false}) }}
    </div>
{% endif %}
